package com.example.evensystem.view

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.evensystem.model.database.SystemDb
import com.example.evensystem.model.entity.Account
import com.example.evensystem.ui.theme.EvenSystemTheme
import com.example.evensystem.viewmodel.MainViewModel
import com.example.evensystem.viewmodel.startNavigation
import org.koin.android.ext.android.inject
import org.koin.androidx.viewmodel.ext.android.viewModel

class MainActivity : ComponentActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val vm: MainViewModel by viewModel()
        val list = mutableStateListOf(Account("",""))
        list.removeAt(0)

        setContent {
            EvenSystemTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background
                ) {
                   startNavigation(viewModel = vm,this,list)
                }
            }
        }
    }
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {

    EvenSystemTheme {

    }


}